<?php

namespace catchAdmin\pc\tables;

use catchAdmin\pc\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;

class Feedback extends CatchTable
{

    public function Table()
    {
        return $this
            ->getTable('feedback')
            ->header([
                HeaderItem::label('名称')
                    ->prop('title'),
                HeaderItem::label('内容')
                    ->prop('content'),
                HeaderItem::label('反馈时间')
                    ->prop('created_at'),
            ])
            ->withSearch([
                Search::label('名称')
                    ->text('title', '名称')
                    ->clearable(true),
                Search::label('内容')
                    ->text('content', '内容')
                    ->clearable(true),

            ])
            ->selectionChange()
            ->withApiRoute('feedback')
            ->withActions([
                Actions::create(),
            ])
            ->render();
    }


    public function form()
    {
        return Factory::create('feedback');
    }

}
